<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>图书列表</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function selectAdmin(count, bookname,classcode,id) {

			try {
				$("#count", window.opener.document).val(count);
				$("#bookname", window.opener.document).val(bookname);
				$("#classcode", window.opener.document).val(classcode);
				$("#bkId", window.opener.document).val(id);

			}
			catch (e) {
				// 防止父页面没有此方法导致报错
			}
			window.close();
			return false;
		}

		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>
	<form:form id="searchForm" modelAttribute="bkBookinfo" action="${ctx}/book/manage/listData" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>分类号：</label><form:input path="classcode" htmlEscape="false" maxlength="20" class="input-medium"/>&nbsp;
		<label>ISBN：</label><form:input path="isbn" htmlEscape="false" maxlength="20" class="input-medium"/>&nbsp;
		<label>书名：</label><form:input path="bookname" htmlEscape="false" maxlength="30" class="input-medium"/>&nbsp;
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
		<tr>
			<th>序号</th>
			<th>书名</th>
			<th>作者</th>
			<th>ISBN</th>
            <th>分类号</th>
			<th>出版社</th>
			<th>出版日期</th>
			<th>价格</th>
			<th>操作</th>
		</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="info" varStatus="status">
			<tr>
				<td>${status.count}</td>
				<td>${info.bookname}</td>
				<td>${info.author}</td>
				<td>${info.isbn}</td>
                <td>${info.classcode}</td>
				<td>${info.publisher}</td>
				<td>${info.pubdate}</td>
				<td>${info.price}</td>
				<td>
					<input type="button" value="选择" onclick="selectAdmin('${info.bookstore.banid}','${info.bookname}','${info.classcode}','${info.id}')"/>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>